#include <thread>
#include <string>

#include "test_template.h"
#include "test_boost.h"
#include "test_meta.h"
#include "test_boost_trait.h"
#include "test_boost_asio_serial.hpp"

/**
 * 测试c++模板功能
 */
void test_template();

/**
 *测试类型特征萃取
 */
void test_boost_trait();

/**
 * 测试元函数
 */
void test_meta_();

/**
 * 测试boost::asio库
 */
void test_asio();

/**
 * 测试for循环
 */
void test_for();

/**
 * 测试可变参数
 */
void test_changeableParamsFunc();




int main(int, char **)
{
    // test_template();
    // test_boost_trait();
    // test_meta_();
    // testBind();

    // test_asio();
    return 0;
}

void test_meta_()
{
    std::cout << "meta_func res = " << meta_func<1, 2>::value << std::endl;
    std::cout << "test_typename_return_type res = " << test_typename_return_type<std::string, int, int>() << std::endl;
}

void test_asio()
{
    std::thread t(serverSync);
    t.detach();
    sleep(2);
    std::thread t1(client);
    t1.detach();
    int i = 10;
    while (i > 0)
    {
        std::cout << "======================== " << i << std::endl;
        sleep(1);
        i--;
    }
}

void test_for()
{
    for_();
}

void test_changeableParamsFunc()
{
    changeableParamsFunc(1, 2, 3, 4);
    std::cout << " size = " << m.size() << std::endl;
}

void test_template()
{
    std::cout << "test_non_type_template_param res = " << test_non_type_template_param<bool, true>() << std::endl;
}

void test_boost_trait()
{
    check_simple_type<int>();
}